package com.example.androidexample.qr;

import java.util.Arrays;
import java.util.Objects;

public class NV21Frame {

    private byte[] data  = new byte[0];
    private int widthIN = 0;
    private int heightIN = 0;
    private boolean status = false;

    public byte[] getData() {
        return data;
    }

    public void setData(byte[] data) {
        this.data = data;
    }

    public int getWidthIN() {
        return widthIN;
    }

    public void setWidthIN(int widthIN) {
        this.widthIN = widthIN;
    }

    public int getHeightIN() {
        return heightIN;
    }

    public void setHeightIN(int heightIN) {
        this.heightIN = heightIN;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public NV21Frame(byte[] data, int widthIN, int heightIN, boolean status) {
        this.data = data;
        this.widthIN = widthIN;
        this.heightIN = heightIN;
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NV21Frame nv21Frame = (NV21Frame) o;
        return widthIN == nv21Frame.widthIN &&
                heightIN == nv21Frame.heightIN &&
                status == nv21Frame.status &&
                Arrays.equals(data, nv21Frame.data);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(widthIN, heightIN, status);
        result = 31 * result + Arrays.hashCode(data);
        return result;
    }
}
